<template>
  <div>
    <h3>自组建 ： {{ num }}</h3>
    <button @click="$emit('addNum', 1)">+1</button>
    <button @click="emits('addNum', 1)">+1</button>
    <button @click="handleClick(10)">+10</button>
    <button @click="handleClick(100)">+100</button>
  </div>
</template>


<script setup>
const props = defineProps({
  num: {
    type: Number
  }
})
const emits = defineEmits(['addNum'])

const handleClick = (value) => {
  emits('addNum', value)
}
</script>